/**
* 代码为自动生成 Created by www.magicalcoder.com
* 如果你改变了此类 read 请将此行删除
* 欢迎加入官方QQ群:323237052
*/

layui.config({base : "assets/"}).extend({"iotworkshop_config":"admin/iotworkshop/iotworkshop-config","magicalcoderlist" : "magicalcoder/v001/rmp/magicalcoderlist"})
layui.use(["magicalcoderlist","iotworkshop_config"],function(){
    var config = $.extend(layui.iotworkshop_config,{
        layTable : {
            //表格内容
            elem : '#newsList',
            id : "newsListTable"
            },
            //排序跟数据库实际字段名的映射
        sortMap:{
            workShopId:'work_shop_id',workShopCode:'work_shop_code',workShopName:'work_shop_name',orgId:'org_id',workShopType:'work_shop_type',workShopStatus:'work_shop_status',workShopCountry:'work_shop_country',workShopProvince:'work_shop_province',workShopCity:'work_shop_city',workShopLongitude:'work_shop_longitude',workShopDimension:'work_shop_dimension',remarks:'remarks',creationTime:'creation_time',creationUser:'creation_user',updateTime:'update_time',updateUser:'update_user',spare1:'spare1',spare2:'spare2',spare3:'spare3'
        }
    });
    var  magicalcoderlist = layui.magicalcoderlist(config);
    //绑定所有查询区域控件
    magicalcoderlist.bindQueryArea();
    //表格
    var cols = [[
        {type: "checkbox", fixed:"left", width:50},
                {field: 'workShopId', title: '车间ID', minWidth:100, align:"center",sort:true},

            {field: 'workShopCode', title: '车间代码', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopCode) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopCode" name="workShopCode" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="车间代码"/>'
                }
                , sort:true
            },

            {field: 'workShopName', title: '车间名称', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopName) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopName" name="workShopName" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="车间名称"/>'
                }
                , sort:true
            },

            {field: 'orgId', title: '所属组织ID', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.orgId) +'" class="magicalcoder-table-text layui-input security_list_table_form_orgId" name="orgId" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="所属组织ID"/>'
                }
                , sort:true
            },

            {field: 'workShopType', title: '车间类型', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopType) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopType" name="workShopType" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="车间类型"/>'
                }
                , sort:true
            },

            {field: 'workShopStatus', title: '车间状态', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopStatus) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopStatus" name="workShopStatus" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="车间状态"/>'
                }
                , sort:true
            },

            {field: 'workShopCountry', title: '国家', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopCountry) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopCountry" name="workShopCountry" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="国家"/>'
                }
                , sort:true
            },

            {field: 'workShopProvince', title: '省份', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopProvince) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopProvince" name="workShopProvince" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="省份"/>'
                }
                , sort:true
            },

            {field: 'workShopCity', title: '市', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopCity) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopCity" name="workShopCity" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="市"/>'
                }
                , sort:true
            },

            {field: 'workShopLongitude', title: '经度', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopLongitude) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopLongitude" name="workShopLongitude" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="经度"/>'
                }
                , sort:true
            },

            {field: 'workShopDimension', title: '纬度', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.workShopDimension) +'" class="magicalcoder-table-text layui-input security_list_table_form_workShopDimension" name="workShopDimension" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="纬度"/>'
                }
                , sort:true
            },

            {field: 'remarks', title: '备注', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.remarks) +'" class="magicalcoder-table-text layui-input security_list_table_form_remarks" name="remarks" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="备注"/>'
                }
                , sort:true
            },

            {field: 'creationTime', title: '创建时间', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.creationTime) +'" class="magicalcoder-table-text layui-input security_list_table_form_creationTime" name="creationTime" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="创建时间"/>'
                }
                , sort:true
            },

            {field: 'creationUser', title: '创建人', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.creationUser) +'" class="magicalcoder-table-text layui-input security_list_table_form_creationUser" name="creationUser" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="创建人"/>'
                }
                , sort:true
            },

            {field: 'updateTime', title: '更新时间', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.updateTime) +'" class="magicalcoder-table-text layui-input security_list_table_form_updateTime" name="updateTime" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="更新时间"/>'
                }
                , sort:true
            },

            {field: 'updateUser', title: '更新人', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.updateUser) +'" class="magicalcoder-table-text layui-input security_list_table_form_updateUser" name="updateUser" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="更新人"/>'
                }
                , sort:true
            },

            {field: 'spare1', title: '备用1', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.spare1) +'" class="magicalcoder-table-text layui-input security_list_table_form_spare1" name="spare1" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="备用1"/>'
                }
                , sort:true
            },

            {field: 'spare2', title: '备用2', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.spare2) +'" class="magicalcoder-table-text layui-input security_list_table_form_spare2" name="spare2" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="备用2"/>'
                }
                , sort:true
            },

            {field: 'spare3', title: '备用3', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.spare3) +'" class="magicalcoder-table-text layui-input security_list_table_form_spare3" name="spare3" data-identify="'+d.workShopId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="备用3"/>'
                }
                , sort:true
            },
        {title: '操作', minWidth:250, templet:'#newsListOperateTemplate',fixed:"right",align:"center"}
    ]];
    //表格中的一些事件
    var tableEvent = {
        "tool":function (obj,roleId) {//操作部分的按钮
            return true;//不阻止事件继续执行封装的事件
        },
        "sort":function (obj,safeOrderBy) {//排序
            return true;//不阻止事件继续执行封装的事件
        }
    }
    magicalcoderlist.bindTableArea(cols,tableEvent)
    magicalcoderlist.bindAreaEvents();
})
